package com.zib.bilibili.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.zib.bilibili.R;
import com.zib.bilibili.base.adapter.BaseRcAdapterHelper;
import com.zib.bilibili.base.adapter.BaseRcQuickAdapter;
import com.zib.bilibili.bean.LiveBean;
import com.zib.bilibili.utils.ImageLoader;

/**
 * Created by Administrator on 2016/7/6.
 */
public class LiveFragmentItemAdapter extends BaseRcQuickAdapter<LiveBean.DataBean.PartitionsBean.LivesBean,BaseRcAdapterHelper>{
    protected LiveFragmentItemAdapter(Context context, int layoutResId) {
        super(context, layoutResId);
    }

    @Override
    protected void convert(BaseRcAdapterHelper helper, LiveBean.DataBean.PartitionsBean.LivesBean item) {
        ImageView imageView_live_image = helper.getImageView(R.id.imageView_live_image);
        ImageView imageView_live_icon = helper.getImageView(R.id.imageView_live_icon);
        ImageLoader.getInstance().displayImage(context,item.getOwner().getFace(),imageView_live_icon);
        ImageLoader.getInstance().displayImage(context,item.getCover().getSrc(),imageView_live_image);
        helper.setText(R.id.textView_live_username, item.getOwner().getName());
        helper.setText(R.id.textView_live_count, item.getOnline() + "");
        helper.setText(R.id.textView_live_title,item.getTitle());
    }
}
